﻿using Microsoft.Extensions.DependencyInjection;
using WinFormium.WebResource;
using WinFormium;

namespace DataAcquisition
{
    internal class App : WinFormiumStartup
    {
        protected override MainWindowCreationAction? UseMainWindow(MainWindowOptions opts)
        {
            return opts.UseMainFormium<IndexFormium>();
            //return opts.UseMainForm<RegistrationCodeForm>();
        }

        protected override void WinFormiumMain(string[] args)
        {
            ApplicationConfiguration.Initialize();
        }
        protected override void ConfigureServices(IServiceCollection services)
        {
            // 注册嵌入资源
            services.AddEmbeddedFileResource(new EmbeddedFileResourceOptions
            {
                Scheme = "http",
                DomainName = "dataqcquisition.app.local",
                ResourceAssembly = typeof(Program).Assembly,
                EmbeddedResourceDirectoryName = "wwwroot",
            });
        }
    }
}
